CXX = g++
CXXFLAGS = -Wall -std=c++11

all: server client

# Server build
server: server_main.o server_core.o user_manager.o utils.o
	$(CXX) -o server $^

server_main.o: server_main.cpp server_core.h
	$(CXX) $(CXXFLAGS) -c server_main.cpp

server_core.o: server_core.cpp server_core.h user_manager.h utils.h
	$(CXX) $(CXXFLAGS) -c server_core.cpp

user_manager.o: user_manager.cpp user_manager.h
	$(CXX) $(CXXFLAGS) -c user_manager.cpp

utils.o: utils.cpp utils.h
	$(CXX) $(CXXFLAGS) -c utils.cpp

# Client build
client: client.cpp
	$(CXX) $(CXXFLAGS) -o client client.cpp

clean:
	rm -f *.o server client
